/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package midlet;


import form.SplashForm;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

/**
 *
 * @author aisyah
 */
public class MainMidlet extends MIDlet {
     //Scale
    public static float HScale;
    public static float VScale;

    protected void destroyApp(boolean bln){
        this.notifyDestroyed();
    }

    protected void pauseApp() {
        
    }

    protected void startApp() throws MIDletStateChangeException {
        com.sun.lwuit.Display.init(this);
        //Calculate scale
//        MainMidlet.HScale =  (float)com.sun.lwuit.Display.getInstance().getDisplayWidth()  / 240.0f;
//        MainMidlet.VScale =  (float)com.sun.lwuit.Display.getInstance().getDisplayHeight() / 320.0f;

        MainMidlet.HScale =  (float)com.sun.lwuit.Display.getInstance().getDisplayWidth()  / 320.0f;
        MainMidlet.VScale =  (float)com.sun.lwuit.Display.getInstance().getDisplayHeight() / 240.0f;

//        try {
//            Resources r1 = Resources.open("/res/Mobile.res");
//            UIManager.getInstance().setThemeProps(r1.getTheme(r1.getThemeResourceNames()[0]));
//        } catch (IOException ex) {
//            System.out.println("Resource cannot be loaded");
//        }
        //show splash screen
        new SplashForm(this, null).show();
    }

}
